﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using umbraco.cms.businesslogic.web;
using umbraco.cms.businesslogic.template;
using Umbraco.Ecommerce.BusinessLogic;

namespace Umbraco.Ecommerce.WebShop
{
    public partial class Install : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            pnlFinish.Visible = false;
        }

        protected void btnOK_Click(object sender, EventArgs e)
        {
            //install ecommerce DB
            Library.installsql();

            //Make product datatype
            umbraco.cms.businesslogic.datatype.DataTypeDefinition eComDoc = 
                umbraco.cms.businesslogic.datatype.DataTypeDefinition.MakeNew(new umbraco.BusinessLogic.User(0),"Product");
            eComDoc.DataType = new Umbraco.Ecommerce.DataControls.ProductEditor();

            pnlInstall.Visible = false;
            pnlFinish.Visible = true;

        }
      

    }
}